import { ref } from 'vue'
import { defineStore } from 'pinia'

// 使用setup模式定义
export const appStore = defineStore('appStore', () => {
  const isCollapse = ref<boolean>(false)

  function CHANGE_SIDEBAR (status: boolean) {
    isCollapse.value = status
  }

  function toggleSideBar () {
    CHANGE_SIDEBAR(!isCollapse.value)
  }
  return { isCollapse, toggleSideBar }
},
{
  persist: true
})
